import request from '@/utils/request'
export const articleList = (params) => {
  return request('/article/list', {
    type: 'get',
    params: {
      ...params
    }
  })
}

export const articleSort = (data) => {
  return request({
    url: '/article/sort',
    method: 'post',
    data
  })
}
export const delAarticle = (id) => {
  return request({
    url: `/article/delete/${id}`
  })
}
export const articleDetail = (id) => {
  return request({
    url: `/article/${id}`
  })
}
export const articleSave = (data) => {
  return request({
    url: '/article/create',
    method: 'post',
    data
  })
}

/**
 * 编辑文章详情
 */
export const articleEdit = (data) => {
  return request({
    url: '/article/edit',
    method: 'POST',
    data
  })
}
